import 'package:safetymonitor/generated/json/base/json_convert_content.dart';
import 'package:safetymonitor/app/data/entities/application/get_dict_all_entity.dart';
import 'package:safetymonitor/app/data/common/choice_bean.dart';


GetDictAllEntity $GetDictAllEntityFromJson(Map<String, dynamic> json) {
  final GetDictAllEntity getDictAllEntity = GetDictAllEntity();
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    getDictAllEntity.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    getDictAllEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    getDictAllEntity.createDate = createDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    getDictAllEntity.deleted = deleted;
  }
  final List<GetDictAllEntity>? dictionaryDetails = (json['dictionaryDetails'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<GetDictAllEntity>(e) as GetDictAllEntity).toList();
  if (dictionaryDetails != null) {
    getDictAllEntity.dictionaryDetails = dictionaryDetails;
  }
  final String? dictionaryId = jsonConvert.convert<String>(json['dictionaryId']);
  if (dictionaryId != null) {
    getDictAllEntity.dictionaryId = dictionaryId;
  }
  final String? dictionaryKeyValues = jsonConvert.convert<String>(json['dictionaryKeyValues']);
  if (dictionaryKeyValues != null) {
    getDictAllEntity.dictionaryKeyValues = dictionaryKeyValues;
  }
  final String? dictionaryLabel = jsonConvert.convert<String>(json['dictionaryLabel']);
  if (dictionaryLabel != null) {
    getDictAllEntity.dictionaryLabel = dictionaryLabel;
  }
  final int? dictionarySort = jsonConvert.convert<int>(json['dictionarySort']);
  if (dictionarySort != null) {
    getDictAllEntity.dictionarySort = dictionarySort;
  }
  final String? dictionaryType = jsonConvert.convert<String>(json['dictionaryType']);
  if (dictionaryType != null) {
    getDictAllEntity.dictionaryType = dictionaryType;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    getDictAllEntity.id = id;
  }
  final String? pid = jsonConvert.convert<String>(json['pid']);
  if (pid != null) {
    getDictAllEntity.pid = pid;
  }
  final String? remark = jsonConvert.convert<String>(json['remark']);
  if (remark != null) {
    getDictAllEntity.remark = remark;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    getDictAllEntity.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    getDictAllEntity.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    getDictAllEntity.updateDate = updateDate;
  }
  final bool? isChecked = jsonConvert.convert<bool>(json['isChecked']);
  if (isChecked != null) {
    getDictAllEntity.isChecked = isChecked;
  }
  return getDictAllEntity;
}

Map<String, dynamic> $GetDictAllEntityToJson(GetDictAllEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['deleted'] = entity.deleted;
  data['dictionaryDetails'] = entity.dictionaryDetails?.map((v) => v.toJson()).toList();
  data['dictionaryId'] = entity.dictionaryId;
  data['dictionaryKeyValues'] = entity.dictionaryKeyValues;
  data['dictionaryLabel'] = entity.dictionaryLabel;
  data['dictionarySort'] = entity.dictionarySort;
  data['dictionaryType'] = entity.dictionaryType;
  data['id'] = entity.id;
  data['pid'] = entity.pid;
  data['remark'] = entity.remark;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  data['isChecked'] = entity.isChecked;
  return data;
}

extension GetDictAllEntityExtension on GetDictAllEntity {
  GetDictAllEntity copyWith({
    String? createBy,
    String? createById,
    String? createDate,
    String? deleted,
    List<GetDictAllEntity>? dictionaryDetails,
    String? dictionaryId,
    String? dictionaryKeyValues,
    String? dictionaryLabel,
    int? dictionarySort,
    String? dictionaryType,
    String? id,
    String? pid,
    String? remark,
    String? updateBy,
    String? updateById,
    String? updateDate,
    bool? isChecked,
  }) {
    return GetDictAllEntity()
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..deleted = deleted ?? this.deleted
      ..dictionaryDetails = dictionaryDetails ?? this.dictionaryDetails
      ..dictionaryId = dictionaryId ?? this.dictionaryId
      ..dictionaryKeyValues = dictionaryKeyValues ?? this.dictionaryKeyValues
      ..dictionaryLabel = dictionaryLabel ?? this.dictionaryLabel
      ..dictionarySort = dictionarySort ?? this.dictionarySort
      ..dictionaryType = dictionaryType ?? this.dictionaryType
      ..id = id ?? this.id
      ..pid = pid ?? this.pid
      ..remark = remark ?? this.remark
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate
      ..isChecked = isChecked ?? this.isChecked;
  }
}